#include "DeaconsWidget.h"

void DeaconsWidget::loadPriesthood()
{
	priesthood1->setText(QString("%1").arg(m_youth->deacons().priesthood().req1()));
	priesthood2->setText(QString("%1").arg(m_youth->deacons().priesthood().req2()));
	priesthood3->setText(QString("%1").arg(m_youth->deacons().priesthood().req3()));
	priesthood4->setText(QString("%1").arg(m_youth->deacons().priesthood().req4()));
	priesthood5->setText(QString("%1").arg(m_youth->deacons().priesthood().req5()));
	priesthood6->setText(QString("%1").arg(m_youth->deacons().priesthood().req6()));
	priesthood7->setText(QString("%1").arg(m_youth->deacons().priesthood().req7()));
	priesthood8->setText(QString("%1").arg(m_youth->deacons().priesthood().req8()));
	priesthood9->setText(QString("%1").arg(m_youth->deacons().priesthood().req9()));
	priesthood10->setText(QString("%1").arg(m_youth->deacons().priesthood().req10()));
}

void DeaconsWidget::on_priesthood1_textChanged(const QString& i_percent)
{
    int percent = i_percent.toInt();
    if (percent > 100) percent = 100;
	m_youth->deacons().priesthood().setReq1(percent);
	updateCompletions();
}

void DeaconsWidget::on_priesthood2_textChanged(const QString& i_percent)
{
    int percent = i_percent.toInt();
    if (percent > 100) percent = 100;
	m_youth->deacons().priesthood().setReq2(percent);
	updateCompletions();
}

void DeaconsWidget::on_priesthood3_textChanged(const QString& i_percent)
{
    int percent = i_percent.toInt();
    if (percent > 100) percent = 100;
	m_youth->deacons().priesthood().setReq3(percent);
	updateCompletions();
}

void DeaconsWidget::on_priesthood4_textChanged(const QString& i_percent)
{
    int percent = i_percent.toInt();
    if (percent > 100) percent = 100;
	m_youth->deacons().priesthood().setReq4(percent);
	updateCompletions();
}

void DeaconsWidget::on_priesthood5_textChanged(const QString& i_percent)
{
    int percent = i_percent.toInt();
    if (percent > 100) percent = 100;
	m_youth->deacons().priesthood().setReq5(percent);
	updateCompletions();
}

void DeaconsWidget::on_priesthood6_textChanged(const QString& i_percent)
{
    int percent = i_percent.toInt();
    if (percent > 100) percent = 100;
	m_youth->deacons().priesthood().setReq6(percent);
	updateCompletions();
}

void DeaconsWidget::on_priesthood7_textChanged(const QString& i_percent)
{
    int percent = i_percent.toInt();
    if (percent > 100) percent = 100;
	m_youth->deacons().priesthood().setReq7(percent);
	updateCompletions();
}

void DeaconsWidget::on_priesthood8_textChanged(const QString& i_percent)
{
    int percent = i_percent.toInt();
    if (percent > 100) percent = 100;
	m_youth->deacons().priesthood().setReq8(percent);
	updateCompletions();
}

void DeaconsWidget::on_priesthood9_textChanged(const QString& i_percent)
{
    int percent = i_percent.toInt();
    if (percent > 100) percent = 100;
	m_youth->deacons().priesthood().setReq9(percent);
	updateCompletions();
}

void DeaconsWidget::on_priesthood10_textChanged(const QString& i_percent)
{
    int percent = i_percent.toInt();
    if (percent > 100) percent = 100;
	m_youth->deacons().priesthood().setReq10(percent);
	updateCompletions();
}

